package com.power.using.mydaggerp.contract.detail;

import com.power.using.mydaggerp.base.BasePresenter;
import com.power.using.mydaggerp.base.IBaseActivity;
import com.power.using.mydaggerp.base.IBaseModel;
import com.power.using.mydaggerp.model.bean.douban.book.BookDetailBean;
import com.power.using.mydaggerp.model.bean.douban.book.BookItemBean;

import io.reactivex.Observable;

/**
 * Created by 聪明一只哈 on 2019/10/18.
 * Time: 2019/10/18  10:32
 */
public interface BookDeatilContract {

    abstract class BookDetailPresenter extends BasePresenter<IBookDetailModel,IBookDetailView>{

        /**
         * 加载书籍详情
         *
         * @param id 书籍id
         */
        public abstract void loadBookDetail(String id);

        /**
         * header点击事件
         *
         * @param bean bean
         */
        public abstract void onHeaderClick(BookItemBean bean);


    }



    interface IBookDetailModel extends IBaseModel{

        /**
         * 获取书籍详情
         *
         * @param id 书籍id
         * @return 书籍详情
         */
        Observable<BookDetailBean> getBookDetail(String id);
    }


    interface IBookDetailView extends IBaseActivity{

        /**
         * 显示书籍详情
         *
         * @param bean 书籍详情bean
         */
        void showBookDetail(BookDetailBean bean);
        /**
         * 显示网络错误
         */
        void showNerworkError();
    }
}
